home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / plugin / nsIPluginInstance.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  12KB  |  314 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIPluginInstance.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIPluginInstance_h__
  6. #define __gen_nsIPluginInstance_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIPluginStreamListener_h__
  14. #include "nsIPluginStreamListener.h"
  15. #endif
  16.  
  17. /* For IDL files that don't want to include root IDL files. */
  18. #ifndef NS_NO_VTABLE
  19. #define NS_NO_VTABLE
  20. #endif
  21. #include "nsplugindefs.h"
  22. class nsIPluginInstancePeer; /* forward declaration */
  23.  
  24.  
  25. /* starting interface:    nsIPluginInstance */
  26. #define NS_IPLUGININSTANCE_IID_STR "ebe00f40-0199-11d2-815b-006008119d7a"
  27.  
  28. #define NS_IPLUGININSTANCE_IID \
  29.   {0xebe00f40, 0x0199, 0x11d2, \
  30.     { 0x81, 0x5b, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a }}
  31.  
  32. /**
  33.  * The nsIPluginInstance interface is the minimum interface plugin developers
  34.  * need to support in order to implement a plugin instance. The plugin manager
  35.  * may QueryInterface for more specific types, e.g. nsILiveConnectPluginInstance. 
  36.  *
  37.  * (Corresponds to NPP object.)
  38.  *
  39.  * The old NPP_Destroy call has been factored into two plugin instance 
  40.  * methods:
  41.  *
  42.  * Stop -- called when the plugin instance is to be stopped (e.g. by 
  43.  * displaying another plugin manager window, causing the page containing 
  44.  * the plugin to become removed from the display).
  45.  *
  46.  * Destroy -- called once, before the plugin instance peer is to be 
  47.  * destroyed. This method is used to destroy the plugin instance.
  48.  */
  49. class NS_NO_VTABLE nsIPluginInstance : public nsISupports {
  50.  public: 
  51.  
  52.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPLUGININSTANCE_IID)
  53.  
  54.   /**
  55.      * Initializes a newly created plugin instance, passing to it the
  56.      * plugin instance peer which it should use for all communication
  57.      * back to the browser.
  58.      * 
  59.      * @param aPeer - the corresponding plugin instance peer
  60.      * @result      - NS_OK if this operation was successful
  61.      */
  62.   /* void initialize (in nsIPluginInstancePeer aPeer); */
  63.   NS_IMETHOD Initialize(nsIPluginInstancePeer *aPeer) = 0;
  64.  
  65.   /**
  66.      * Returns a reference back to the plugin instance peer. This method is
  67.      * used whenever the browser needs to obtain the peer back from a plugin
  68.      * instance. The implementation of this method should be sure to increment
  69.      * the reference count on the peer by calling AddRef.
  70.      *
  71.      * @param aPeer - the resulting plugin instance peer
  72.      * @result      - NS_OK if this operation was successful
  73.      */
  74.   /* readonly attribute nsIPluginInstancePeer peer; */
  75.   NS_IMETHOD GetPeer(nsIPluginInstancePeer * *aPeer) = 0;
  76.  
  77.   /**
  78.      * Called to instruct the plugin instance to start. This will be
  79.      * called after the plugin is first created and initialized, and
  80.      * may be called after the plugin is stopped (via the Stop method)
  81.      * if the plugin instance is returned to in the browser window's
  82.      * history.
  83.      *
  84.      * @result - NS_OK if this operation was successful
  85.      */
  86.   /* void start (); */
  87.   NS_IMETHOD Start(void) = 0;
  88.  
  89.   /**
  90.      * Called to instruct the plugin instance to stop, thereby
  91.      * suspending its state.  This method will be called whenever the
  92.      * browser window goes on to display another page and the page
  93.      * containing the plugin goes into the window's history list.
  94.      *
  95.      * @result - NS_OK if this operation was successful
  96.      */
  97.   /* void stop (); */
  98.   NS_IMETHOD Stop(void) = 0;
  99.  
  100.   /**
  101.      * Called to instruct the plugin instance to destroy itself. This
  102.      * is called when it become no longer possible to return to the
  103.      * plugin instance, either because the browser window's history
  104.      * list of pages is being trimmed, or because the window
  105.      * containing this page in the history is being closed.
  106.      *
  107.      * @result - NS_OK if this operation was successful
  108.      */
  109.   /* void destroy (); */
  110.   NS_IMETHOD Destroy(void) = 0;
  111.  
  112.   /**
  113.      * Called when the window containing the plugin instance changes.
  114.      *
  115.      * (Corresponds to NPP_SetWindow.)
  116.      *
  117.      * @param aWindow - the plugin window structure
  118.      * @result        - NS_OK if this operation was successful
  119.      */
  120.   /* void setWindow (in nsPluginWindowPtr aWindow); */
  121.   NS_IMETHOD SetWindow(nsPluginWindow * aWindow) = 0;
  122.  
  123.   /**
  124.      * Called to tell the plugin that the initial src/data stream is
  125.      * ready.  Expects the plugin to return a nsIPluginStreamListener.
  126.      *
  127.      * (Corresponds to NPP_NewStream.)
  128.      *
  129.      * @param aListener - listener the browser will use to give the plugin the data
  130.      * @result          - NS_OK if this operation was successful
  131.      */
  132.   /* void newStream (out nsIPluginStreamListener aListener); */
  133.   NS_IMETHOD NewStream(nsIPluginStreamListener **aListener) = 0;
  134.  
  135.   /**
  136.      * Called to instruct the plugin instance to print itself to a printer.
  137.      *
  138.      * (Corresponds to NPP_Print.)
  139.      *
  140.      * @param aPlatformPrint - platform-specific printing information
  141.      * @result               - NS_OK if this operation was successful
  142.      */
  143.   /* void print (in nsPluginPrintPtr aPlatformPrint); */
  144.   NS_IMETHOD Print(nsPluginPrint * aPlatformPrint) = 0;
  145.  
  146.   /**
  147.      * Returns the value of a variable associated with the plugin instance.
  148.      *
  149.      * @param aVariable - the plugin instance variable to get
  150.      * @param aValue    - the address of where to store the resulting value
  151.      * @result          - NS_OK if this operation was successful
  152.      */
  153.   /* void getValue (in nsPluginInstanceVariable aVariable, in voidPtr aValue); */
  154.   NS_IMETHOD GetValue(nsPluginInstanceVariable aVariable, void * aValue) = 0;
  155.  
  156.   /**
  157.      * Handles an event. An nsIEventHandler can also get registered with with
  158.      * nsIPluginManager2::RegisterWindow and will be called whenever an event
  159.      * comes in for that window.
  160.      *
  161.      * Note that for Unix and Mac the nsPluginEvent structure is different
  162.      * from the old NPEvent structure -- it's no longer the native event
  163.      * record, but is instead a struct. This was done for future extensibility,
  164.      * and so that the Mac could receive the window argument too. For Windows
  165.      * and OS2, it's always been a struct, so there's no change for them.
  166.      *
  167.      * (Corresponds to NPP_HandleEvent.)
  168.      *
  169.      * @param aEvent   - the event to be handled
  170.      * @param aHandled - set to PR_TRUE if event was handled
  171.      * @result - NS_OK if this operation was successful
  172.      */
  173.   /* void handleEvent (in nsPluginEventPtr aEvent, out boolean aHandled); */
  174.   NS_IMETHOD HandleEvent(nsPluginEvent * aEvent, PRBool *aHandled) = 0;
  175.  
  176. };
  177.  
  178. /* Use this macro when declaring classes that implement this interface. */
  179. #define NS_DECL_NSIPLUGININSTANCE \
  180.   NS_IMETHOD Initialize(nsIPluginInstancePeer *aPeer); \
  181.   NS_IMETHOD GetPeer(nsIPluginInstancePeer * *aPeer); \
  182.   NS_IMETHOD Start(void); \
  183.   NS_IMETHOD Stop(void); \
  184.   NS_IMETHOD Destroy(void); \
  185.   NS_IMETHOD SetWindow(nsPluginWindow * aWindow); \
  186.   NS_IMETHOD NewStream(nsIPluginStreamListener **aListener); \
  187.   NS_IMETHOD Print(nsPluginPrint * aPlatformPrint); \
  188.   NS_IMETHOD GetValue(nsPluginInstanceVariable aVariable, void * aValue); \
  189.   NS_IMETHOD HandleEvent(nsPluginEvent * aEvent, PRBool *aHandled); 
  190.  
  191. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  192. #define NS_FORWARD_NSIPLUGININSTANCE(_to) \
  193.   NS_IMETHOD Initialize(nsIPluginInstancePeer *aPeer) { return _to Initialize(aPeer); } \
  194.   NS_IMETHOD GetPeer(nsIPluginInstancePeer * *aPeer) { return _to GetPeer(aPeer); } \
  195.   NS_IMETHOD Start(void) { return _to Start(); } \
  196.   NS_IMETHOD Stop(void) { return _to Stop(); } \
  197.   NS_IMETHOD Destroy(void) { return _to Destroy(); } \
  198.   NS_IMETHOD SetWindow(nsPluginWindow * aWindow) { return _to SetWindow(aWindow); } \
  199.   NS_IMETHOD NewStream(nsIPluginStreamListener **aListener) { return _to NewStream(aListener); } \
  200.   NS_IMETHOD Print(nsPluginPrint * aPlatformPrint) { return _to Print(aPlatformPrint); } \
  201.   NS_IMETHOD GetValue(nsPluginInstanceVariable aVariable, void * aValue) { return _to GetValue(aVariable, aValue); } \
  202.   NS_IMETHOD HandleEvent(nsPluginEvent * aEvent, PRBool *aHandled) { return _to HandleEvent(aEvent, aHandled); } 
  203.  
  204. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  205. #define NS_FORWARD_SAFE_NSIPLUGININSTANCE(_to) \
  206.   NS_IMETHOD Initialize(nsIPluginInstancePeer *aPeer) { return !_to ? NS_ERROR_NULL_POINTER : _to->Initialize(aPeer); } \
  207.   NS_IMETHOD GetPeer(nsIPluginInstancePeer * *aPeer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPeer(aPeer); } \
  208.   NS_IMETHOD Start(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Start(); } \
  209.   NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); } \
  210.   NS_IMETHOD Destroy(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Destroy(); } \
  211.   NS_IMETHOD SetWindow(nsPluginWindow * aWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetWindow(aWindow); } \
  212.   NS_IMETHOD NewStream(nsIPluginStreamListener **aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewStream(aListener); } \
  213.   NS_IMETHOD Print(nsPluginPrint * aPlatformPrint) { return !_to ? NS_ERROR_NULL_POINTER : _to->Print(aPlatformPrint); } \
  214.   NS_IMETHOD GetValue(nsPluginInstanceVariable aVariable, void * aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aVariable, aValue); } \
  215.   NS_IMETHOD HandleEvent(nsPluginEvent * aEvent, PRBool *aHandled) { return !_to ? NS_ERROR_NULL_POINTER : _to->HandleEvent(aEvent, aHandled); } 
  216.  
  217. #if 0
  218. /* Use the code below as a template for the implementation class for this interface. */
  219.  
  220. /* Header file */
  221. class nsPluginInstance : public nsIPluginInstance
  222. {
  223. public:
  224.   NS_DECL_ISUPPORTS
  225.   NS_DECL_NSIPLUGININSTANCE
  226.  
  227.   nsPluginInstance();
  228.  
  229. private:
  230.   ~nsPluginInstance();
  231.  
  232. protected:
  233.   /* additional members */
  234. };
  235.  
  236. /* Implementation file */
  237. NS_IMPL_ISUPPORTS1(nsPluginInstance, nsIPluginInstance)
  238.  
  239. nsPluginInstance::nsPluginInstance()
  240. {
  241.   /* member initializers and constructor code */
  242. }
  243.  
  244. nsPluginInstance::~nsPluginInstance()
  245. {
  246.   /* destructor code */
  247. }
  248.  
  249. /* void initialize (in nsIPluginInstancePeer aPeer); */
  250. NS_IMETHODIMP nsPluginInstance::Initialize(nsIPluginInstancePeer *aPeer)
  251. {
  252.     return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254.  
  255. /* readonly attribute nsIPluginInstancePeer peer; */
  256. NS_IMETHODIMP nsPluginInstance::GetPeer(nsIPluginInstancePeer * *aPeer)
  257. {
  258.     return NS_ERROR_NOT_IMPLEMENTED;
  259. }
  260.  
  261. /* void start (); */
  262. NS_IMETHODIMP nsPluginInstance::Start()
  263. {
  264.     return NS_ERROR_NOT_IMPLEMENTED;
  265. }
  266.  
  267. /* void stop (); */
  268. NS_IMETHODIMP nsPluginInstance::Stop()
  269. {
  270.     return NS_ERROR_NOT_IMPLEMENTED;
  271. }
  272.  
  273. /* void destroy (); */
  274. NS_IMETHODIMP nsPluginInstance::Destroy()
  275. {
  276.     return NS_ERROR_NOT_IMPLEMENTED;
  277. }
  278.  
  279. /* void setWindow (in nsPluginWindowPtr aWindow); */
  280. NS_IMETHODIMP nsPluginInstance::SetWindow(nsPluginWindow * aWindow)
  281. {
  282.     return NS_ERROR_NOT_IMPLEMENTED;
  283. }
  284.  
  285. /* void newStream (out nsIPluginStreamListener aListener); */
  286. NS_IMETHODIMP nsPluginInstance::NewStream(nsIPluginStreamListener **aListener)
  287. {
  288.     return NS_ERROR_NOT_IMPLEMENTED;
  289. }
  290.  
  291. /* void print (in nsPluginPrintPtr aPlatformPrint); */
  292. NS_IMETHODIMP nsPluginInstance::Print(nsPluginPrint * aPlatformPrint)
  293. {
  294.     return NS_ERROR_NOT_IMPLEMENTED;
  295. }
  296.  
  297. /* void getValue (in nsPluginInstanceVariable aVariable, in voidPtr aValue); */
  298. NS_IMETHODIMP nsPluginInstance::GetValue(nsPluginInstanceVariable aVariable, void * aValue)
  299. {
  300.     return NS_ERROR_NOT_IMPLEMENTED;
  301. }
  302.  
  303. /* void handleEvent (in nsPluginEventPtr aEvent, out boolean aHandled); */
  304. NS_IMETHODIMP nsPluginInstance::HandleEvent(nsPluginEvent * aEvent, PRBool *aHandled)
  305. {
  306.     return NS_ERROR_NOT_IMPLEMENTED;
  307. }
  308.  
  309. /* End of implementation class template. */
  310. #endif
  311.  
  312.  
  313. #endif /* __gen_nsIPluginInstance_h__ */
  314.